<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img"
           src="//img1.qunarzz.com/sight/p0/1609/f1/f10a167617911cb6a3.water.jpg_600x330_e5534717.jpg"
           alt="">
      <div class="banner-info">
        <div class="banner-title">合肥万达水乐园</div>
        <div class="banner-num">
          <span class="iconfont banner-icon">&#xe60f;</span>
          39
        </div>
      </div>
    </div>
    <common-gallery :imgs="imgs" v-show="showGallery" @close="handleGalleryClose"></common-gallery>
  </div>
</template>

<script>
  import CommonGallery from '@/common/gallery/Gallery'

  export default {
    name: "DetailBanner",
    data () {
      return {
        showGallery: false,
        imgs: ['http://img1.qunarzz.com/sight/p0/1609/7b/7b4f53bc94429201a3.water.jpg_r_800x800_7305b6b6.jpg', 'http://img1.qunarzz.com/sight/p0/1609/93/932ce81cdd37962ba3.water.jpg_r_800x800_c433552a.jpg']
      }
    },
    components: {
      CommonGallery
    },
    methods: {
      handleBannerClick () {
          this.showGallery = true;
      },
      handleGalleryClose () {
        this.showGallery = false;
      }
    }
  }
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
  .banner
    position relative
    overflow hidden
    height 0
    padding-bottom 55%
    .banner-img
      width 100%
    .banner-info
      display flex
      position absolute
      left 0
      right 0
      bottom 0
      height .6rem
      color #fff
      background-image linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, .8))
      .banner-title
        flex 1
        font-size .32rem
        padding 0 .2rem
        flex-direction column
        margin-top .14rem
      .banner-num
        padding 0 .2rem
        line-height .32rem
        height .32rem
        margin-top .14rem
        margin-right .2rem
        border-radius .2rem
        font-size .24rem
        background-color rgba(0, 0, 0, .8)
        .banner-icon
          font-size .24rem
</style>
